package io.github.talelin.latticy.service.oms;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import io.github.talelin.latticy.dto.order.CreateOrderDTO;
import io.github.talelin.latticy.dto.order.OrderPageDTO;
import io.github.talelin.latticy.dto.order.PageListDTO;
import io.github.talelin.latticy.dto.order.TakeDownPageListDTO;
import io.github.talelin.latticy.model.oms.OrderDO;
import io.github.talelin.latticy.vo.FindResultVO;
import io.github.talelin.latticy.vo.WarehouseVO;
import io.github.talelin.latticy.vo.oms.OrderDetailVO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author generator@wulongbo
 * @since 2022-06-28
 */
public interface OrderService extends IService<OrderDO> {

    /**
     * 获取仓库列表
     *
     * @return
     */
    List<WarehouseVO> getOmsWarehouseById();

    /**
     * 创建订单
     *
     * @param dto
     * @return
     */
    boolean createOrder(CreateOrderDTO dto);


    /**
     * 更新订单
     * @param orderNo
     * @param dto
     * @return
     */
    boolean updateOrderByOrderNo(Long orderNo,CreateOrderDTO dto);

    /**
     * 删除订单
     * @param orderNo
     * @return
     */
    boolean deleteByOrderNo(Long orderNo);

    /**
     * 查询订单
     * @param orderNo
     * @return
     */
    OrderDetailVO getByOrderNo(Long orderNo);

    /**
     * 发货审核
     * @return
     */
    boolean approveOrder(Long orderNo);

    /**
     * 作废订单
     * @return
     */
    boolean cancelOrder(Long orderNo);

    /**
     * 恢复订单
     * @return
     */
    boolean recoveryOrder(Long orderNo);

    boolean checkExistByOrderNo(Long orderNo);

    /**
     * 订单分页
     *
     * @param orderPageDTO
     * @return
     */
    IPage<OrderDO> getOrdersPage(OrderPageDTO orderPageDTO);

    /**
     * 下架订单分页查询
     * @param pageListDTO
     * @return
     */
    FindResultVO takeDownPageList(TakeDownPageListDTO pageListDTO);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    FindResultVO findById(Long id);

    /**
     * wms 分页查询
     * @param pageListDTO
     * @return
     */
    FindResultVO pageList(PageListDTO pageListDTO);

    /**
     * 根据ids查询
     * @param orderOns
     * @return
     */
    FindResultVO findByIds(List<Long> orderOns);
}
